<template>
	<view class="motion-video-detail-page page">
		<view class="article-title">{{detail.title}}</view>
		<view class="time">发布时间：{{detail.createTime.substr(0,10)}}</view>
		<view class="content">
			<mp-html :content="detail.content"></mp-html>
		</view>
	</view>
</template>

<script>
	import {videoDetail} from '@/api/video'
	export default{
		data(){
			return{
				detail:{
					title:'',
					content:'',
					createTime:'',
				}
			}
		},
		methods:{
			getDetail(id){
				uni.showLoading({
					title:'加载中',
					mask:true
				})
				videoDetail({id}).then(res=>{
					this.detail=res;
				})
			}
		},
		onLoad(opt) {
			if(!opt.id){
				this.showToast('参数错误',()=>{
					uni.navigateBack()
				})
				return
			}
			this.getDetail(opt.id)
		}
	}
</script>

<style lang="scss" scoped>
	.motion-video-detail-page{
		padding: 30rpx;
		.article-title{
			font-size: 34rpx;
			font-weight: bold;
			margin-bottom: 20rpx;
		}
		.time{
			font-size: 28rpx;
			color: #999;
			margin-bottom: 20rpx;
		}
		.content{
			width: 100%;
		}
	}
</style>